<template>
  <div>
    <p></p>
    <button @click="myFn">按钮</button>
  </div>
</template>


<script>
/**
 * 1.markRaw...
 */
import { ref, markRaw } from "vue";
import { reactive } from "vue";
export default {
  name: "App",
  setup() {
    let obj = { name: "ls", age: 18 };
    obj = markRaw(obj); //阻止数据追踪
    let state = reactive(obj);
    function myFn() {
      state.name = "zs";
      console.log(state);
    }
    return { state, myFn };
  }
};
</script>
